package org.oproject.rmi.hessian.exception;

/**
 * 
 * @see 
 * @author shenqing
 * @since 1.0
 * @version 1.0, Nov 16, 2010 5:22:36 PM
 */
public abstract class AbstractHessianException extends RuntimeException
{
	private static final long serialVersionUID = 1L;
	
	private ExceptionMessage message;
	
	public AbstractHessianException(String _message)
	{
		super(_message);
		this.message = new ExceptionMessage();
	}
	
	public AbstractHessianException(String _message, Throwable cause)
	{
		super(_message, cause);
		this.message = new ExceptionMessage();
	}
	
	/**
	 * 获取异常类型
	 * @return
	 */
	public String type()
	{
		return this.getClass().getSimpleName();
	}
	
	/**
	 * 获取封装好的异常信息
	 * @return
	 */
	public ExceptionMessage exceptionMessage()
	{
		return this.message;
	}
}
